package com.idealighter.game.games.fqzs.message;

import com.baidu.bjf.remoting.protobuf.FieldType;
import com.baidu.bjf.remoting.protobuf.annotation.Protobuf;

import com.idealighter.game.core.annotation.ResMsg;
import com.idealighter.game.gamehall.dto.MemInfo;
import com.idealighter.game.games.fqzs.dto.BetInfo;
import com.idealighter.game.games.fqzs.dto.IconRateInfo;
import com.idealighter.game.message.ModuleMsgIdConstant;
import com.idealighter.game.message.core.ResMessage;

import java.util.List;

import lombok.Data;

@ResMsg(ModuleMsgIdConstant.Fqzs.GAME_INFO)
@Data
public class ResGameInfoMsg implements ResMessage {
  @Protobuf(order = 1)
  private int id = ModuleMsgIdConstant.Fqzs.GAME_INFO;
  @Protobuf(order = 2)
  private StageInfo stageInfo; // 游戏信息
  @Protobuf(order = 3)
  private BankerAndApplysInfo bankerAndApplysInfo; // 庄家信息和申请列表
  @Protobuf(order = 4, fieldType = FieldType.INT32)
  private List<Integer> historyRewardIcons; // 历史icon
  @Protobuf(order = 5)
  private List<MemInfo> mems; // 房间成员信息列表
  @Protobuf(order = 6)
  private List<IconRateInfo> iconRateInfos; // 图标赔率
  @Protobuf(order = 7)
  private List<BetInfo> betInfos; // 图标下注信息(下注阶段/游戏阶段/结算阶段)
  @Protobuf(order = 8)
  private GameStageInfo gaming; // 游戏阶段数据

  // 总筹码
  @Protobuf(order = 9)
  public long totalChips = 0;

  @Data
  public static class StageInfo {
    @Protobuf(order = 1)
    private int status; // 游戏阶段
    @Protobuf(order = 2)
    private long leftTime; // 该阶段剩余的时间(s)
  }

  @Data
  public static class BankerAndApplysInfo {
    @Protobuf(order = 1, fieldType = FieldType.INT64)
    private List<Long> bankerApplys; // 申请坐庄的用户编号列表
    @Protobuf(order = 2)
    private BankerInfoMsg banker; // 庄家信息
  }

  @Data
  public static class BankerInfoMsg {
    @Protobuf(order = 1)
    private long playerId;
    // 昵称
    @Protobuf(order = 2)
    private String name;
    // 筹码
    @Protobuf(order = 3)
    private long chips;
    // 局数
    @Protobuf(order = 4)
    private int num;
    // 成绩
    @Protobuf(order = 5)
    private long score;
  }

  @Data
  public static class GameStageInfo {
    // 中奖图标
    @Protobuf(order = 1)
    private int iconIndex;
    // 玩家的收益
    @Protobuf(order = 2)
    private long playerBillChips;
    // 庄家收益
    @Protobuf(order = 3)
    private long bankerBillChips;
    // 中奖排行榜
    @Protobuf(order = 4)
    private List<TopRewardItemDto> topRewards;
  }

  @Data
  public static class TopRewardItemDto {
    @Protobuf(order = 1)
    private Long playerId;
    @Protobuf(order = 2)
    private String nickName;
    @Protobuf(order = 3)
    private Long chips;
  }

}
